// RepositoryDlg.cpp : implementation file
//

#include "stdafx.h"
#include "Updater_MFC.h"
#include "RepositoryDlg.h"
#include "RepositoryAddDlg.h"

// CRepositoryDlg dialog

IMPLEMENT_DYNAMIC(CRepositoryDlg, CDialog)

CRepositoryDlg::CRepositoryDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CRepositoryDlg::IDD, pParent)
{

}

CRepositoryDlg::~CRepositoryDlg()
{
}

void CRepositoryDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_LIST_SITES, list);
}


BEGIN_MESSAGE_MAP(CRepositoryDlg, CDialog)
	ON_BN_CLICKED(IDC_BUTTON_ADD, &CRepositoryDlg::OnBnClickedButtonAdd)
	ON_BN_CLICKED(IDC_BUTTON_EDIT, &CRepositoryDlg::OnBnClickedButtonEdit)
	ON_BN_CLICKED(IDC_BUTTON_REMOVE, &CRepositoryDlg::OnBnClickedButtonRemove)
	ON_BN_CLICKED(IDOK, &CRepositoryDlg::OnBnClickedOk)
END_MESSAGE_MAP()


// CRepositoryDlg message handlers

void CRepositoryDlg::OnBnClickedButtonAdd()
{
	CRepositoryAddDlg dlg;
	dlg.e_location="http://";
	INT_PTR nResponse = dlg.DoModal();
	if (nResponse == IDOK)
	{
		list.AddString(dlg.e_name+" - "+dlg.e_location);	
		
	}
	else if (nResponse == IDCANCEL)
	{
		// TODO: Place code here to handle when the dialog is
		//  dismissed with Cancel
	}
	
}

BOOL CRepositoryDlg::OnInitDialog(){
	CDialog::OnInitDialog();
	//ListView_SetExtendedListViewStyle(list.m_hWnd,LVS_EX_CHECKBOXES);
	return TRUE;
}

void CRepositoryDlg::OnBnClickedButtonEdit()
{
	//
}


void CRepositoryDlg::OnBnClickedButtonRemove()
{
	// TODO: Add your control notification handler code here
}


void CRepositoryDlg::OnBnClickedOk()
{
	// TODO: Add your control notification handler code here
	CDialog::OnOK();
}
